# -*- coding: utf-8 -*-
# @Time        :2025/3/11 11:24
# @Author      :文刀水寿
# @File        : 27_爬虫_selenium_淘宝网测试-edge.py
"""
 @Description :
"""
from selenium import webdriver
from selenium.webdriver.edge.service import Service

driver_path = "D:\PythonCharm\PyCharmProject\pythonProject\爬虫\msedgedriver.exe"
service = Service(executable_path=driver_path)

url = 'https://huodong.taobao.com/wow/a/act/tao/dailygroup/23509/24308/wupr?spm=a21bo.jianhua/a.201859.8.54252a89whGzCa&wh_pid=daily-560791&disableNav=YES&status_bar_transparent=true'
browser = webdriver.Edge(service=service)
browser.get(url)
content = browser.page_source

# import urllib.request
# url = 'https://huodong.taobao.com/wow/a/act/tao/dailygroup/23509/24308/wupr?spm=a21bo.jianhua/a.201859.8.54252a89whGzCa&wh_pid=daily-560791&disableNav=YES&status_bar_transparent=true'
#
# headers = {
#     'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36'
# }
#
# request = urllib.request.Request(url=url, headers=headers)
#
# respsonse = urllib.request.urlopen(request)
#
# content = respsonse.read().decode('utf8')
#
# print(content)
from lxml import etree

tree = etree.HTML(content)

list = tree.xpath("//*[@id='8760559950']/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/text()")

print(list)
